package cn.hy.spider;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;

public class ProxyUtil {
    public static String getProxy() {
        String json = HttpUtil.get("http://127.0.0.1:5010/get/");
        return JSONUtil.parseObj(json).getStr("proxy");
    }

    public static void delProxy(String proxy) {
        System.out.println("proxy = " + proxy);
        HttpUtil.get(StrUtil.format("http://127.0.0.1:5010/delete/?proxy={}", proxy));
    }


    public static boolean isValidProxy(String proxy) {
        return false;
    }
}
